﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;

public partial class Customer : System.Web.UI.Page
{
    Faisal_MoversEntities entites = new Faisal_MoversEntities();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            var f = (from r in entites.Reservations
                     join t in entites.Travels on r.Travel equals t
                     join c in entites.Customers on r.Customer equals c
                     join ru in entites.Routes on t.Route equals ru
                     // where c.user_name == user_name && c.mobile_number == mobile_number && r.is_book == true
                     select new Reservation
                     {
                         travel_id = t.travel_id,
                         route_from = ru.route_from,
                         route_to = ru.route_to,
                         travelDate = t.travelDate,
                         travelDepatureTime = t.travelDepatureTime,
                         travelArrivalTime = t.travelArrivalTime,
                         res_no_of_seats = r.res_no_of_seats,
                         seat_number = r.seat_number
                     }).ToList();
            GridView1.DataSource = f;
            GridView1.DataBind();
        }

    }
}